import React, { useEffect, useState } from 'react'
import { getList } from '../../api/us'
import Mylist from '../../compont/Mylist'
const Index = () => {
  const [list, setList] = useState([])
  const getlist = async () => {
    const res = await getList()
    setList(res.rows)
    console.log(res);
  }
  useEffect(() => {
    getlist()
  }, [])
  return (
    <div>
      {
        list.map((item, i) => (
          <Mylist key={i} {...item}/>
        ))
      }
    </div>
  )
}

export default Index
